<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
		<!-- ENDLIBS -->
        <link rel="stylesheet" type="text/css" href="../lib/resources/css/ext-all.css"/>
        <script type="text/javascript" src="../lib/js/ext-base-debug.js">
        </script>
        <script type="text/javascript" src="../lib/js/ext-all-debug.js">
        </script>
        <script type="text/javascript" src="MenuToolbar.js">
        </script>
    </head>
    <body>
        <script type="text/javascript">
            Ext.onReady(function(){
                var tb = new Ext.ux.MenuToolbar({
                    id: 'bar',
                    height: 30,
                    url: 'menu.json'
                });
				var positionTmp = "<div class='position'>当前位置：{0}<div>";
                tb.on('itemclick', function(tbar, item){
                    var path = tbar.getItemPath(item);
                    Ext.getCmp('workpanel').setTitle(String.format(positionTmp, path));
					alert(item.url);
                }, this);
                
                var viewport = new Ext.Viewport({
                    layout: 'border',
                    items: [{
                        region: 'center',
                        layout: 'fit',
                        tbar: tb,
                        items: [{
                            id: 'workpanel',
                            title: String.format(positionTmp, '首页')
                        }]
                    },{
						region:'south',
						title:'1111',
						bodyStyle:{fontSize:'0px'}
					}]
                });
            });
        </script>
    </body>
</html>
